<template>
  <el-date-picker v-model="value" :format="props.format" />
</template>

<script setup lang="ts">
import { ref, watch } from 'vue'

const emit = defineEmits(['update:value'])
const props = defineProps({
  value: {
    type: Number,
    default: new Date().getTime(),
  },
  format: {
    type: String,
    default: 'YYYY-MM-DD',
  },
})
const value = ref(props.value)

watch(value, (newValue) => {
  emit('update:value', newValue)
})
</script>

<style scoped></style>
